home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / cool / cool.lha / ice / util / copy_ice next >
Encoding:
Text File  |  1991-09-04  |  1.6 KB  |  55 lines

  1. #!/bin/sh
  2. #
  3. # Copyright (C) 1991 Texas Instruments Incorporated.
  4. #
  5. # Permission is granted to any individual or institution to use, copy, modify,
  6. # and distribute this software, provided that this complete copyright and
  7. # permission notice is maintained, intact, in all copies and supporting
  8. # documentation.
  9. #
  10. # Texas Instruments Incorporated provides this software "as is" without
  11. # express or implied warranty.
  12. #
  13. # Shell script to copy ice (the current directory) to specified host
  14. # on specified path.
  15. #
  16. # Usage: cd ice; util/copy_ice <host> <path>
  17. #
  18. # Example: cd ice; util/copy_ice osage /epoch/misc/ice
  19. #
  20.  
  21. rsh $1 rm -rf "$2/*" &
  22. rm -f /tmp/icefiles /tmp/unice
  23. find . -print > /tmp/icefiles
  24.  
  25. # don't copy *.o *.a *.txt *.s *.i *..c *.bak *.3T
  26. egrep '^.*\.(o|a|txt|s|i|\.c|bak|3T)$' /tmp/icefiles > /tmp/unice
  27.  
  28. # don't copy */core */.?* *# *~
  29. egrep '.*/core$|.*/\..+|.*#$|.*~$' /tmp/icefiles >> /tmp/unice
  30.  
  31. # don't copy RCS directories
  32. find . -name 'RCS' -print >> /tmp/unice
  33.  
  34. # don't copy program executables, except for bin directories
  35. find . -perm -0111 -type f -print | egrep -v 'bin' >> /tmp/unice;
  36.  
  37. #don't copy these directories
  38. echo "./buglist" >> /tmp/unice
  39. echo "./foils" >> /tmp/unice
  40. echo "./papers" >> /tmp/unice
  41. echo "./pos" >> /tmp/unice
  42. echo "./iv" >> /tmp/unice
  43. echo "./util" >> /tmp/unice
  44.  
  45. sort /tmp/unice > /tmp/unicesorted
  46. mv /tmp/unicesorted /tmp/unice
  47. rm /tmp/icefiles
  48.  
  49. # wait for "rm -rf" on other machine to finish
  50. wait
  51. echo "tar XhcofB /tmp/unice - . | rsh $1 cd $2 \; umask 22 \; tar xfB -"
  52. tar XhcofB /tmp/unice - . | \
  53.     rsh $1 cd $2 \; umask 22 \; tar xfB -
  54. rm /tmp/unice
  55.